package cn.moningxi.service.impl;

import cn.moningxi.bean.CCollect;
import cn.moningxi.mapper.CCollectMapper;
import cn.moningxi.service.CCollectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;
import java.util.List;


@Service
public class CCollectServiceImpl implements CCollectService {

    @Autowired
    private CCollectMapper cCollectMapper;


    @Override
    public List<CCollect> queryCcollect(String customerId) {
        return cCollectMapper.queryCcollect(customerId);
    }

    @Override
    public void saveCollect(Integer collectId) {
        cCollectMapper.saveCollect(collectId);
    }

    @Override
    public CCollect queryByCustomerIdAndGoodId(String customerId, String goodsId) {
        return cCollectMapper.queryByCustomerIdAndGoodId(customerId, goodsId);
    }

    @Override
    public Integer addCCollcet(CCollect cCollect) {
        cCollect.setAddTime(LocalDateTime.now());
        return cCollectMapper.addCCollcet(cCollect);
    }

    @Override
    public Integer modifyIsCancle(CCollect cCollect) {
        cCollect.setModifiedTime(LocalDateTime.now());
        return cCollectMapper.modifyIsCancle(cCollect);
    }


}
